<div class="row"> 
  <small>
  <div class="span9">
   <div class="clearfix txtleft search" style="background-color:#f8f8f8; padding:10px; margin:10px 0px;"> 
      <form action="/<*$controller*>/parents" method="get" class="form-horizontal">       
		<input  type="text" name="text"  placeholder="输入手机号、登陆账号" value="<*$keywolrd*>" /> 
        <input type="submit" class="btn btn-success"  value="查询"  >
         <input type="button" class="btn btn-success" value="清空查询" onclick="window.location='/user/parents'" >
        &nbsp;&nbsp;&nbsp;&nbsp; 
        <!--<input type="button" class="btn btn-primary " value="添加家长" onclick="window.location='/user/add'" > -->
        <input type="button" class="btn btn-primary " value="合并家长" onclick="window.location='/mergeparents'" > 
       </form>
	</div>	 
  <*if $result|@count neq 0*> 
  <div class="table_content">
		<div class="ta_top"></div>
		<div class="ta_in"> 
   <table cellpadding="0" cellspacing="0" class="table">
			<tr>
			 
			<th style="width:10%;">登陆账号</th>
			<th style="width:10%;">密码</th>
			<th style="width:8%;">名称</th>
			<th style="width:10%;">电话</th>
			<th style="width:10%;">锁定</th>
			<th style="width:5%;">推送</th>
            <th style="width:5%;">安装</th>
            <th style="width:20%;">孩子</th>
            <th style="width:22%;">操作</th> 
			<th>&nbsp;</th>
		</tr>
     
    <*foreach from=$result item=a key =key name=foo*>
		<tr> 
			<td><*$a.username*></td>
			<td><*$a.password*></td>
			<td><*$a.realname*></td>
			<td><*$a.mobile*></td>
			<td><*if $a.islock*><a onclick="lock()"><i class="icon-lock"></i></a><*else*><a onclick="unlock()"><img src="/images/unlock.png" title="正常" style="width:16px; height:16px;" /></a><*/if*></td>
			<td><*if $a.canpull*><i class="icon-ok"></i><*else*><i class="icon-remove"></i><*/if*></td>
			<td><*if $a.isinstalled*><i class="icon-ok"></i><*else*><i class="icon-remove"></i><*/if*></td> 
         <!--   <td>  <button type="button" class="btn  btn-small" onclick="javascript:deleteit(<*$a.pid*>,'parents')" ><i class="icon-trash"></i>删除</button></td>-->
            <td> <a role="button" class="btn btn-primary" onclick="javascript:haveparents(<*$a.pid*>,<*$pageNum*>)"><i class="icon-user icon-white"> </i>孩子</a>&nbsp;&nbsp;&nbsp;&nbsp;</td>
            <td><a   role="button" class="btn" data-toggle="modal" onclick="javascript:editit(<*$a.pid*>,<*$pageNum*>)"><i class="icon-pencil"> </i> 修改</a></td>
            <td>&nbsp;</td>
		</tr>
		<*/foreach*>
       <tr>
        	<td colspan="8"><*$page*></td>
            <td>&nbsp;</td>
        </tr>
      <*else*>  
          <tr>
        	<td colspan="8"> 没有您要的结果,请改变你的搜索条件！</td>
            <td>&nbsp;</td>
        </tr> 
       <*/if*> 
        </table>
        </div>
        <div class="ta_bottom"></div>
	  </div> 
     
    </div>
    </small>
</div>
 

<script type="text/javascript">
 

function deleteit(id,type)
{
  if(confirm("删除将不能恢复")){
   window.location='/<*$controller*>/delete/id/'+id+'/type/'+type;
  }
}

function haveparents(id,page)
{ 
   window.location='/<*$controller*>/haveparents/id/'+id+'/page/'+page;
}

function editit(id,pageNum)
{
	 
 	window.location='/<*$controller*>/editparents/id/'+id+'/pageNum/'+pageNum;
}
function opcourse(id)
{  
	//alert(reason[14]);
	var url  = '/<*$controller*>/lock/';

	var pars = '&id=' + id;
	//var pars = '&id=' + id +'&name=' + name+'&studentno=' + studentno +'&attend=' + attend + '&leave=' + leave + '&reason=' + reason; 
	var myAjax = new Ajax.Request( url, { method: 'post', parameters: pars, onComplete:showResponse_course});

}

function showResponse_course(originalRequest)
{
	//alert(originalRequest.responseText);
	if(originalRequest.responseText =='-1'){
		alert('参数错误');
		return false;
	}else if(originalRequest.responseText =='-2'){
		alert('请输入原始密码！');
		return false;
	}else if(originalRequest.responseText =='-3'){
		alert('请输入新密码！');
		return false;
	}else if(originalRequest.responseText =='-4'){
		alert('2次密码不一致！');
		return false;
	}else if(originalRequest.responseText =='-5'){
		alert('新密码和旧密码不能一致！');
		return false;
	}else if(originalRequest.responseText =='-6'){
		alert('原始密码错误！');
		return false;
	}else if (originalRequest.responseText =='1')
	{
		alert('修改成功，请重新登录！');
		parent.location.reload();
	}

}


 
</script>
